/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.fd.manager.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.fd.domain.bo.DocumentCodePoolBO;
import com.xy.biz.fd.domain.query.DocumentCodePoolQuery;
import com.xy.biz.fd.domain.converter.DocumentCodePoolConverter;
import com.xy.biz.fd.manager.DocumentCodePoolManager;
import com.xy.biz.fd.dao.DocumentCodePoolDao;

/**
 *
 *
 * @author zgy
 * @date 2021-6-11
 */
@Service
public class DocumentCodePoolManagerImpl implements DocumentCodePoolManager {

	@Autowired
	private DocumentCodePoolDao documentCodePoolDao;

	@Override
	public int saveDocumentCodePool(DocumentCodePoolBO documentCodePoolBO) {
		return documentCodePoolDao.saveDocumentCodePool(DocumentCodePoolConverter.toPO(documentCodePoolBO));
	}

	@Override
	public int saveAllDocumentCodePool(Collection<DocumentCodePoolBO> collection) {
		return documentCodePoolDao.saveAllDocumentCodePool(DocumentCodePoolConverter.toPO(collection));
	}

	@Override
	public int updateDocumentCodePool(DocumentCodePoolBO documentCodePoolBO) {
		return documentCodePoolDao.updateDocumentCodePool(DocumentCodePoolConverter.toPO(documentCodePoolBO));
	}

	@Override
	public int updateDocumentCodePoolByBO(DocumentCodePoolBO documentCodePoolBO) {
		return documentCodePoolDao.updateDocumentCodePoolByBO(DocumentCodePoolConverter.toPO(documentCodePoolBO));
	}

	/**
	 * 更新
	 * @param collection
	 */
	@Override
	public int updateAllDocumentCodePoolByCode(Collection<DocumentCodePoolBO> collection) {
		return documentCodePoolDao.updateAllDocumentCodePoolByCode(DocumentCodePoolConverter.toPO(collection));
	}

	@Override
	public int deleteDocumentCodePool(Long documentCodePoolId) {
		return documentCodePoolDao.deleteDocumentCodePool(documentCodePoolId);
	}

	@Override
	public DocumentCodePoolBO getDocumentCodePool(Long documentCodePoolId) {
		return DocumentCodePoolConverter.fromPO(documentCodePoolDao.getDocumentCodePool(documentCodePoolId));
	}

	@Override
	public List<DocumentCodePoolBO> listDocumentCodePoolById(Collection<Long> collection) {
		return DocumentCodePoolConverter.fromPO(documentCodePoolDao.listDocumentCodePoolById(collection));
	}

	@Override
	public List<DocumentCodePoolBO> listDocumentCodePool(DocumentCodePoolQuery query) {
		return DocumentCodePoolConverter.fromPO(documentCodePoolDao.listDocumentCodePool(query));
	}

	@Override
	public int countDocumentCodePool(DocumentCodePoolQuery query) {
		return documentCodePoolDao.countDocumentCodePool(query);
	}

}
